package com.zb.vo;

import com.zb.annotation.NumberPattern;
import com.zb.entity.FieldValOptionVo;
import com.zb.utils.VerificUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import java.util.List;


/**
 * @Author WEN
 * @Date 2023/11/6 0006
 **/
@Data
@ApiModel("编码用户自定义字段值对象")
public class CodeUserRegisterFieldValVo {

    @ApiModelProperty(value = "字段值ID，新增不必传，修改必传")
    private Long id;

    @ApiModelProperty(value = "编码自定义字段ID", required = true)
    private Long codeFieldId;

    @NumberPattern(regexp = VerificUtil.FIELD_TYPE, message = "字段类型参数不合法")
    @ApiModelProperty(value = "字段类型：1-文本，2-多行文本，3-单选，4-多选，5-多图，6-附件，7-视频，8-评分", required = true, example = "1")
    private Integer type;

    @Length(max = 10, message = "字段名称长度限制 10 个字符")
    @ApiModelProperty(value = "字段名称", required = true)
    private String name;

    @Length(max = 500, message = "字段值允许输入 0~500 个")
    @ApiModelProperty(value = "字段值")
    private String value;

    @Valid
    @ApiModelProperty(value = "字段选项值对象")
    private List<FieldValOptionVo> optVos;
}
